<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/27
 * Time: 21:05
 */

namespace app\api\controller;


use Bt\BtApi;

class System extends Common
{
    public function info(){
        $info = $this->SERVER_INFO;

        $bt = new BtApi($info["server"] , $info["key"] , $info["port"]);
        $res = $bt->get(1001);
        $arr = json_decode($res);
        if(!$arr){
            return output(2002);
        }
        return output(0 , $arr);
    }

    public function diskinfo(){
        $info = $this->SERVER_INFO;
        $bt = new BtApi($info["server"] , $info["key"] , $info["port"]);
        $res = $bt->get(1002);
        $arr = json_decode($res);
        if(!$arr){
            return output(2002);
        }
        return output(0 , $arr);
    }

    public function networkinfo(){
        $info = $this->SERVER_INFO;

        $bt = new BtApi($info["server"] , $info["key"] , $info["port"]);
        $res = $bt->get(1003);
        $arr = json_decode($res);
        if(!$arr){
            return output(2002);
        }
        return output(0 , $arr);
    }
}